//
//  FSTableViewCell.m
//  Trade
//
//  Created by 刘沿 on 16/4/5.
//  Copyright © 2016年 刘沿. All rights reserved.
//

#import "FSTableViewCell.h"

@implementation FSTableViewCell

+(instancetype)TableViewCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"FSTableViewCell" owner:nil options:nil] lastObject];

}

//重写set方法 给cell赋值
-(void)setModel:(FSupCommingModel *)model{
    _model = model;

    self.titleLabel.text = model.title;

    if (model.time.length != 0 && model.state.length != 0 && model.name.length !=0) {
        self.DesLabel.text = [NSString stringWithFormat:@"%@/%@/%@",model.time,model.state,model.name];
    }else if(model.time.length != 0 && model.state.length == 0 && model.name.length ==0){
    
        self.DesLabel.text = [NSString stringWithFormat:@"%@",model.time];
    }

    //icon 图片
    if([model.iconType isEqualToString:@"SendBox"]){
        self.iconImageView.image = [UIImage imageNamed:@"alread_read.jpg"];
    }else if ([model.iconType isEqualToString:@"InBox"]){
        if ([self.model.isRead isEqualToString:@"1"]) {
            self.iconImageView.image = [UIImage imageNamed:@"alread_read.jpg"];
        }else{
            self.iconImageView.image = [UIImage imageNamed:@"not_read"];
            self.backgroundColor = [UIColor lightGrayColor];
        }
        
    }else{
        self.iconImageView.image = [UIImage imageNamed:@"fileicon.jpg"];
    }

    
}


@end
